package com.cookie.framework.utils;

import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.view.View;

/**
 * 项目名:    MeetProject
 * 包名:      com.cookie.framework.utils
 * 文件名:    SystemUi
 * 创建者:    cookie
 * 创建时间:   2019/12/27 0:34
 * 描述:      沉浸式
 */

public class SystemUi {

    public static void fixSystemUI(Activity activity) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            //获取最顶层view
            activity.getWindow().getDecorView().setSystemUiVisibility(
                    View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
        }
    }
}
